import axios from '~/config/axios'

/**
 * 职位列表
 * @param {*} json 
 */
export function JobList(json) {
    const url = '/worker/jobList'

    return axios.post(url, json)
}

/**
 * 地区代理列表
 */
export function Area() {
    const url = '/area'

    return axios.get(url)
}

/**
 * 职位详情
 * @param {*} json 
 */
export function JobItem(json) {
    return new Promise((resolve, reject) => {
        axios.get('/worker/job/show', {
                params: json
            })
            .then(function(response) {
                resolve(response)
            })
            .catch(function(error) {
                reject(error)
            });
    })
}

/**
 * 职位收藏
 * @param {*} json 
 */
export function Star(json) {
    const url = '/worker/job/star'
    return axios.post(url, json)
}